package com.phychips.rcp;

/**
 * This defines all the constant values.
 */
public class RcpConst {
    // packet format
    public static final byte PREAMBLE = (byte) 0xBB;
    public static final byte ENDMARK = 0x7E;
    public static final byte HEADER_CMD = 0x00;

    // message type
    public static final byte RCP_MSG_CMD = 0x00;
    public static final byte RCP_MSG_RSP = 0x01;
    public static final byte RCP_MSG_NOTI = 0x02;
    public static final byte RCP_MSG_TEST = 0x03;
    public static final byte RCP_MSG_CAP = 0x04;

    // message code
    public static final byte RCP_CMD_INVALID = 0x00;

    public static final byte RCP_CMD_CTL_RD_PWR = 0x01;
    public static final byte RCP_CMD_CTL_RD_CON = 0x02;
    public static final byte RCP_CMD_GET_RD_INFO = 0x03;

    public static final byte RCP_CMD_GET_REGION = 0x06;
    public static final byte RCP_CMD_SET_REGION = 0x07;

    public static final byte RCP_CMD_CTL_RESET = 0x08;
    public static final byte RCP_CMD_CTL_RESET_OBSOLETE = 0x01;

    public static final byte RCP_CMD_GET_C_SEL_PARAM = 0x0B;
    public static final byte RCP_CMD_SET_C_SEL_PARAM = 0x0C;

    public static final byte RCP_CMD_GET_C_QRY_PARAM = 0x0D;
    public static final byte RCP_CMD_SET_C_QRY_PARAM = 0x0E;

    public static final byte RCP_CMD_GET_CH = 0x11;
    public static final byte RCP_CMD_GET_CH_OBSOLETE = (byte) 0xAA;
    public static final byte RCP_CMD_SET_CH = 0x12;
    public static final byte RCP_CMD_SET_CH_OBSOLETE = (byte) 0xAB;

    public static final byte RCP_CMD_GET_FH_LBT = 0x13;
    public static final byte RCP_CMD_SET_FH_LBT = 0x14;

    public static final byte RCP_CMD_GET_TX_PWR = (byte) 0xB3;
    public static final byte RCP_CMD_SET_TX_PWR = (byte) 0xB2;

    public static final byte RCP_CMD_CTL_CW = 0x17;
    public static final byte RCP_CMD_CTL_CW_OBSOLETE = (byte) 0xB0;

    public static final byte RCP_CMD_READ_C_UII = 0x22;
    public static final byte RCP_CMD_READ_C_UII_RSSI = 0x23;
    public static final byte RCP_CMD_READ_C_USER_DT = 0x24;
    public static final byte RCP_CMD_READ_C_UII_TID = 0x25;
    public static final byte RCP_CMD_READ_C_EX2 = 0x26;
    public static final byte RCP_CMD_STRT_AUTO_READ = 0x27;
    public static final byte RCP_CMD_STOP_AUTO_READ = 0x28;

    public static final byte RCP_CMD_READ_C_DT = 0x29;
    public static final byte RCP_CMD_READ_C_DT_EX = 0x2A;
    public static final byte RCP_CMD_GET_SESSION = 0x2E;
    public static final byte RCP_CMD_SET_SESSION = 0x2F;

    public static final byte RCP_CMD_GET_HOPPING_TBL = 0x30;
    public static final byte RCP_CMD_SET_HOPPING_TBL = 0x31;

    public static final byte RCP_CMD_GET_MODULATION = 0x32;
    public static final byte RCP_CMD_SET_MODULATION = 0x33;

    public static final byte RCP_CMD_GET_ANTICOL_MODE = 0x34;
    public static final byte RCP_CMD_SET_ANTICOL_MODE = 0x35;

    public static final byte RCP_CMD_STRT_AUTO_READ_EX = 0x36;
    public static final byte RCP_CMD_STOP_AUTO_READ_EX = 0x37;

    public static final byte RCP_CMD_START_AUTO_READ_RSSI = 0x38;
    public static final byte RCP_CMD_STOP_AUTO_READ_RSSI = 0x39;
    public static final byte RCP_CMD_STRT_AUTO_READ_EX2 = 0x3A;
    public static final byte RCP_CMD_WRITE_C_DT = 0x46;

    public static final byte RCP_CMD_BLOCKWRITE_C_DT = 0x47;
    public static final byte RCP_CMD_BLOCKERASE_C_DT = 0x48;

    public static final byte RCP_CMD_TRANSPORT = 0x4D;

    // for NXP custom command
    public static final byte RCP_CMD_READSIGNATURE = (byte) 0x58;

    public static final byte RCP_CMD_KILL_RECOM_C = 0x65;

    public static final byte RCP_CMD_LOCK_C = (byte) 0x82;

    //Authentication 2013.04. 18  by UngTae.KIM
    public static final byte RCP_CMD_AUTHENTICATE = (byte) 0x84;
    public static final byte RCP_CMD_UNTRACEABLE = (byte) 0x85;

    public static final byte RCP_CMD_AUTHENTICATE_EX = (byte) 0x86;
    public static final byte RCP_CMD_UNTRACEABLE_EX = (byte) 0x87;

    //Set,Get Beep 2013. 04. 24 by UngTae.KIM
    public static final byte RCP_CMD_GET_BEEP = (byte) 0xAA;
    public static final byte RCP_CMD_SET_BEEP = (byte) 0xAB;
    public static final byte RCP_CMD_PACKET_TEST = (byte) 0xAC;
    public static final byte RCP_CMD_FER_TEST = (byte) 0xAD; //FER TEST
    public static final byte RCP_CMD_CAL_GPADC = (byte) 0xAF;

    public static final byte RCP_CMD_GET_TEMPERATURE = (byte) 0xB7;
    public static final byte RCP_CMD_GET_RSSI = (byte) 0xC5;
    public static final byte RCP_CMD_SCAN_RSSI = (byte) 0xC6;
    public static final byte RCP_CMD_GET_LEAKAGE_RSSI = (byte) 0xCE;

    public static final byte RCP_UPDATE_REGISTRY = (byte) 0xD2;
    public static final byte RCP_ERASE_REGISTRY = (byte) 0xD3;
    public static final byte RCP_GET_REGISTRY_ITEM = (byte) 0xD4;

    public static final byte GET_POWER_TABLE = (byte) 0xD8;
    public static final byte SET_POWER_TABLE = (byte) 0xD9;

    public static final byte COMMAND_FAIL = (byte) 0xFF;

    public static final byte PDR_STATUS = (byte) 0xB0;
    public static final byte PDR_INFO_SET = (byte) 0xB1;

    public static final byte RCP_BATTERY_RES = (byte) 0xDD;

    //public static final byte COMMAND_FAIL = (byte)0xFF;


    // message argument
    public static final int SLEEP = 0x00;
    public static final int DEEPSLEEP = 0x01;

    public static final int MODEL = 0x00;
    public static final int SERIAL_NUM = 0x01;
    public static final int MANUFACTURER = 0x02;
    public static final int FREQUENCY = 0x03;
    public static final int TAG_TYPE = 0x04;

    public static final int REGION_KOREA = 0x11;
    public static final int REGION_US = 0x21;
    public static final int REGION_EU = 0x31;
    public static final int REGION_JAPAN = 0x41;
    public static final int REGION_CHINA1 = 0x51;
    public static final int REGION_CHINA2 = 0x52;

    public static final int INVENTORY_S0 = 0x00;
    public static final int INVENTORY_S1 = 0x01;
    public static final int INVENTORY_S2 = 0x02;
    public static final int INVENTORY_S3 = 0x03;
    public static final int INVENTORY_SL = 0x04;

    public static final int MB_RFU = 0x00;
    public static final int MB_EPC = 0x01;
    public static final int MB_TID = 0x02;
    public static final int MB_USER = 0x03;

    public static final int TRUC_DISABLE = 0x00;
    public static final int TRUC_ENABLE = 0x01;

    public static final int DR81 = 0x00;
    public static final int DR643 = 0x01;

    public static final int NO_PILOT = 0x00;
    public static final int PILOT = 0x01;

    public static final int SEL_ALL1 = 0x00;
    public static final int SEL_ALL2 = 0x01;
    public static final int SEL_NOT_SL = 0x02;
    public static final int SEL_SL = 0x03;

    public static final int SESSION_S0 = 0x00;
    public static final int SESSION_S1 = 0x01;
    public static final int SESSION_S2 = 0x02;
    public static final int SESSION_S3 = 0x03;

    public static final int TARGET_A = 0x00;
    public static final int TARGET_B = 0x01;

    public static final int MIN_SLOT = 0x00;
    public static final int MAX_SLOT = 0x0F;

    public static final int FH_DISABLE = 0x00;
    public static final int FH_ENABLE = 0x01;

    public static final int LBT_DISABLE = 0x00;
    public static final int LBT_ENABLE = 0x01;

    public static final int CW_DISABLE = 0x00;
    public static final int CW_ENABLE = 0x01;

    public static final int CW_SIG_OFF = 0x00;
    public static final int CW_SIG_ON = 0xFF;

    public static final int HIGH_SENSITIVE = 0x00;
    public static final int HIGH_SPEED = 0x01;
    public static final int MANUAL = 0xFF;

    public static final int RESERVE_B = 0x01;
    public static final int RESERVE_C = 0x02;

    public static final int STORE = 0x01;
    public static final int ERASE = 0xFF;

    public static final int REGISTRY_VERSION = 0x0000;

    public static final int TX_POWER_TABLE = 0x0009;

    public static final int NO_RN16_HANDLE = 0x00;
    public static final int APPEND_RN16_HANDLE = 0x01;

    public static final int NO_CRC = 0x00;
    public static final int APPEND_CRC = 0x01;

    public static final int NO_ACTION_STATE = 0x00;
    public static final int SELECT_STATE = 0x01;
    public static final int QUERY_STATE = 0x02;
    public static final int REPLY_STATE = 0x03;
    public static final int ACKNOWLEDGED_STATE = 0x04;
    public static final int OPEN_STATE = 0x05;
    public static final int SECURED_STATE = 0x06;

    // return value including error
    public static final byte NO_ERROR = 0x00;
    public static final byte READER_NOT_READY = 0x01;
    public static final byte INVALID_ARGUMENT = 0x02;
    public static final byte INVALID_PACKET = 0x03;
    public static final byte INVALID_PACKET_CRC = 0x04;
    public static final byte NOT_RESPONSE = 0x05;
    public static final byte NOT_NOTIFICATION = 0x06;
    public static final byte UNEXPECTED_RESPONSE = 0x07;
    public static final byte INVALID_RESPONSE_ARGUMENT = 0x08;
    public static final byte AUTOREAD_COMPLETE = (byte) 0xF0;
    public static final byte UNEXPECTED_NOTIFICATION = (byte) 0xF1;
    public static final byte SERIAL_OPEN_FAIL = (byte) 0xF2;
    public static final byte SERIAL_READ_FAIL = (byte) 0xF3;
    public static final byte SERIAL_WRITE_FAIL = (byte) 0xF4;
    public static final byte NATIVE_NOT_SUPPORT = (byte) 0xF5;


    // command failure code
    public static final byte READ_MEM_FAILURE = 0x09;
    public static final byte WRITE_DATA_FAILURE = 0x10;
    public static final byte BUSY_READ_MULTIPLE = 0x0B;
    public static final byte NOT_IN_READ_MULTIPLE = 0x0D;
    public static final byte INVALID_COMMAND_PARAM = 0x0E;    // this should not happen
    public static final byte KILL_TAG_FAILURE = 0x12;
    public static final byte LOCK_TAG_FAILURE = 0x13;
    public static final byte READ_TAG_FAILURE = 0x15;
    public static final byte NOT_SUPPORTED_COMMAND = 0x18;
    public static final byte CRC_ERROR = (byte) 0xFF;
    public static final byte UNKNOWN_FAILURE = (byte) 0xFE;

}
